<?php
/* @var $this BannerController */
/* @var $model Banner */
/* @var $form CActiveForm */
?>
<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'category-form',
    // Please note: When you enable ajax validation, make sure the corresponding
    // controller action is handling ajax validation correctly.
    // There is a call to performAjaxValidation() commented in generated controller code.
    // See class documentation of CActiveForm for details on this.
    'htmlOptions'=>array('class'=>'form-horizontal', 'enctype'=>'multipart/form-data'),
    'enableAjaxValidation'=>false,
)); ?>

    <?php echo $form->errorSummary($model); ?>
    <div class="form-group">
        <label class="col-sm-2 control-label">图片</label>
        <div class="col-sm-10 image">
            <?php echo $form->fileField($model,'img', array('size'=>60,'maxlength'=>255,'class'=>'form-control')); ?>

            <div style='position: relative'>
                <img class="pretty-file img-responsive" src="<?=$model->img?>" alt="" text="选择图片" nonePicUrl="<?=Yii::app()->request->baseUrl;?>/resource/backend/images/none.jpg" style="max-width:200px;max-height:200px;">

                <div onclick="$(this).parents('.image').find('input[type=hidden]').val(0);$(this).prev().attr('src', '<?=Yii::app()->request->baseUrl;?>/resource/backend/images/none.jpg');$(this).remove()" style='position:absolute;width:50px;padding:5px 3px 3px 5px;top:5px;left:6px;background:black;opacity:0.6;color:white;cursor:pointer'>
                    <i class='fa fa-trash' aria-hidden='true'> 删除</i>
                </div>

            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">跳转链接</label>
        <div class="col-sm-10">
            <?php echo $form ->textField( $model , 'link', array('size'=>60,'maxlength'=>255,'class'=>'form-control'));?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">描述</label>
        <div class="col-sm-10">
            <?php echo $form ->textField( $model , 'desc', array('size'=>60,'maxlength'=>255,'class'=>'form-control'));?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">新窗口打开</label>
        <div class="col-sm-10">
            <?php echo $form ->radioButtonList( $model , 'target',Constants::getTargetOpenMethod(), array('separator'=>'&nbsp;&nbsp;', 'class'=>'iradio_minimal-blue'));?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">排序</label>
        <div class="col-sm-10">
            <?php echo $form ->textField( $model , 'sort', array('size'=>60,'maxlength'=>255,'class'=>'form-control'));?>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-2 control-label">状态</label>
        <div class="col-sm-10">
            <?php echo $form ->radioButtonList( $model , 'status',Constants::getYesNoItems(), array('separator'=>'&nbsp;&nbsp;','class'=>'iradio_minimal-blue'));?>
        </div>
    </div>
    <div class="hr hr-18 dotted"></div>
    <div class="clearfix">
        <div class="col-md-offset-2 col-md-10">
            <button class="btn btn-white btn-info btn-round" type="submit"><i class="ace-icon fa fa-floppy-o bigger-120 blue"></i>保存</button>
            &nbsp;
            <button class="btn btn-white btn-default btn-round" type="reset"><i class="ace-icon fa fa-times red2"></i>取消</button>
        </div>
    </div>
<?php $this->endWidget(); ?>

